
package entity.MRP.ProductionPlan;


import javax.persistence.Entity;
import javax.persistence.ManyToOne;


@Entity
public class PlannedDailyDemand extends PlannedDemand {
    
    @ManyToOne
    private PlannedWeeklyDemand plannedWeeklyDemand;
    
    private String dayName;
    
    private Long dailyDemandA;
    private Long dailyDemandB;
    private Long dailyDemandC;
    private Long dailyDemandD;

    public String getDayName() {
        return dayName;
    }

    public void setDayName(String dayName) {
        this.dayName = dayName;
    }

    public PlannedWeeklyDemand getPlannedWeeklyDemand() {
        return plannedWeeklyDemand;
    }

    public void setPlannedWeeklyDemand(PlannedWeeklyDemand plannedWeeklyDemand) {
        this.plannedWeeklyDemand = plannedWeeklyDemand;
    }

    public Long getDailyDemandA() {
        return dailyDemandA;
    }

    public void setDailyDemandA(Long dailyDemandA) {
        this.dailyDemandA = dailyDemandA;
    }

    public Long getDailyDemandB() {
        return dailyDemandB;
    }

    public void setDailyDemandB(Long dailyDemandB) {
        this.dailyDemandB = dailyDemandB;
    }

    public Long getDailyDemandC() {
        return dailyDemandC;
    }

    public void setDailyDemandC(Long dailyDemandC) {
        this.dailyDemandC = dailyDemandC;
    }

    public Long getDailyDemandD() {
        return dailyDemandD;
    }

    public void setDailyDemandD(Long dailyDemandD) {
        this.dailyDemandD = dailyDemandD;
    }
    
    public Long getDailyDemand(String productName)
    {
        if (productName.compareTo("A") == 0) return getDailyDemandA();
        else if (productName.compareTo("B") == 0) return getDailyDemandB();
        else if (productName.compareTo("C") == 0) return getDailyDemandC();
        else if (productName.compareTo("D") == 0) return getDailyDemandD();
        else return new Long(-1);
    }
}
